//
//  person.m
//  久违没有学会的归档
//
//  Created by mac on 16/9/17.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "person.h"

@implementation person

//归档
-(void)encodeWithCoder:(NSCoder *)aCoder
{

    [aCoder encodeObject:self.name forKey:@"name"];
    [aCoder encodeInteger:self.age forKey:@"age"];
}
//解归档
-(instancetype)initWithCoder:(NSCoder *)aDecoder
{

    self.name=[aDecoder decodeObjectForKey:@"name"];
    self.age=[aDecoder decodeIntegerForKey:@"age"];

    return self;
}

@end
